package filters;

import draw.ExploringMedics;


public class PowerColorFilter extends AbstractColorFilter{

    public PowerColorFilter(int[][] imageDescription) {
        super(imageDescription);
    }
    
    @Override
    public void doFilted() {
        int c = 255;
        double gamma = 0.14;
        
        for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {
                
                imageDescription[i][j] = 
                        (int) (c * Math.pow(1.0/ExploringMedics.WHITE * imageDescription[i][j], gamma));
                if (imageDescription[i][j]>ExploringMedics.WHITE){
                    imageDescription[i][j] = ExploringMedics.WHITE;
                }
            }
        }
    }
    
}
